Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
How `String["fromCharCode"]` acts like `String.fromCharCode()` in javascript?

Search engine will ignore the [ ] ", so I can't get the answer. I took a test and find out they resulted the same, but I'm a js rookie and I don't know how they equals to each other.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

fromCharCode 'lives' as a static method of the String Object. Such a method has a key and a value, visualised: {fromCharCode: function() {...}}. You can retrieve (access) the method using it's key directly String.fromCharCode or 'bracket' style String['fromCharCode']. This is true for all Objects.

The bracket notation may be usefull when the key contains special characters, see snippet.

See also

const someObj = {
  dotNotation: 'hello world',
  'non dot Notation': 'hello world you too',
};

console.log(someObj.dotNotation);
// the last property can not be retrieved with dot notation
// console.log(someObj.non dot Notation);
// so
console.log(someObj['non dot Notation']);

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!